<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">
<head>
<title>Market place</title>
</head>
<f:view>
	<body>
		<ui:composition>
			<p:dialog id="shoppingCartDialog" header="#{msgs.shoppingCart}"
				widgetVar="shoppingCartDlg" modal="true" showEffect="explode"
				hideEffect="clip" height="350" width="650">

				<p:panelGrid columns="1" style="width:100%">

					<p:commandButton value="#{msgs.checkOut}" type="submit"
						disabled="#{shoppingCartModel.isBasketEmpty}" immediate="true"
						action="/user/checkOut.xthml?faces-redirect=true" title="#{msgs.customer}:#{shoppingCartModel.customer.lastName} #{shoppingCartModel.customer.firstName} #{msgs.requiredDate}:#{shoppingCartModel.requiredDate.dateLabel}"
						style="float:right;background:green; color:white;margin-top:15px">
					</p:commandButton>

						<p:dataTable border="" value="#{shoppingCartModel.basket}"
							sortBy="1" var="orderDetail" style="width:100%;"
							rowClasses="oddRow, evenRow">
							<p:column>
								<h:graphicImage library="images"
									value="../#{orderDetail.product.icon}16.png"></h:graphicImage>
								<h:outputLabel value="#{orderDetail.product.nameLabel}"></h:outputLabel>

							</p:column>
							<p:column>
								<h:outputText value="#{orderDetail.orderedQuantity} " />

								<h:outputLabel value="#{orderDetail.product.stockUnitLabel}" />
							</p:column>
							<p:column>

								<h:outputLabel
									value="#{orderDetail.orderedPrice}/#{orderDetail.product.priceUnitLabel}"
									style="float:right">
									<f:convertNumber type="currency" currencySymbol="$"
										minFractionDigits="2" maxFractionDigits="2" />
								</h:outputLabel>
							</p:column>

							<p:column>
								<h:outputText value="≈"
									rendered="#{!orderDetail.product.isCanCaculateExactAmount}"
									style="font:green;font-size:1.2em"></h:outputText>
								<h:outputLabel value="#{orderDetail.orderedSubTotal}"
									style="float:right">
									<f:convertNumber type="number" minFractionDigits="2"
										maxFractionDigits="2" />
								</h:outputLabel>
							</p:column>
							<p:summaryRow>
								<p:column colspan="3">
									<h:outputText value="#{msgs.total}" style="float:right"></h:outputText>
								</p:column>
								<p:column colspan="">
									<h:outputText id="inCartAmount"
										value="#{shoppingCartModel.order.orderedTotalAmount}"
										style="position:relative;float:right;font-weight:bold;text-align:right">
										<f:convertNumber type="currency" currencySymbol="$"
											minFractionDigits="2" maxFractionDigits="2" />
									</h:outputText>
								</p:column>
							</p:summaryRow>
						</p:dataTable>
				</p:panelGrid>
			</p:dialog>
		</ui:composition>
	</body>
</f:view>
</html>